FUNCTION
text.matches
Matches this text against the specified regular expression.
Regular expressions use the same syntax as java.util.regex.Pattern.
Examples:
val names = ["Alice", "Victor", "Viktor", "Victoria", "V\\ctor"];
print(names @* { .matches("Vi[a-z]tor") }); // prints [Victor, Viktor]
print(names @* { .matches("Vic.*") }); // prints [Victor, Victoria]
print(names @* { .matches("V\\\\c.*") }); // prints [V\ctor]
Parameters
- regex — the regular expression to match against
Throws
exception— ifregexis not a valid regular expression
See Also
Since
0.6.0
© 2026 Chromia